<?php
namespace  My\Controller;
use Utuo\BackgroundController;
class MicroAllianceContentController extends BackgroundController{
	private $allianceId;
	
	public function _initialize() {
		$this->allianceId=I('micro_alliance_id');
		$this->setControllerTitle('微联盟内容');
		$this->setActionTitle(array(
				'index' => '微联盟内容列表',
				'add' => '微联盟内容添加',
				'modify' => '微联盟内容修改',
				'recycle' => '回收站',
		),'',array('micro_alliance_id'=>$this->allianceId));
		$this->setActionNav(array(
				'index',
				'add',
				'recycle'
		));
	
	}
	public function getLists($is_deleted){
		$condation=array(
				'cid'=>$this->aid,
				'is_deleted'=>$is_deleted,
				'micro_alliance_id'=>$this->allianceId
		);
		$microAllianceContent= M('MicroAllianceContent')->where($condation)->page($this->getPage(),$this->getPageSize())->order('id desc')->select();
		$count=M('MicroAllianceContent')->where($condation)->count();
		$this->showPage($count, $this->getPageSize());
		$this->assign("microAllianceContent",$microAllianceContent);
		$this->assign("micro_alliance_id",$this->allianceId);
		$this->display();
	}
	public function addAction(){
		$this->assign("micro_alliance_id",$this->allianceId)->display('save');
	}
	public function modifyAction($id){
		$microAllianceContent=D('MicroAllianceContent')->getOneById($id);
		$this->assign("microAllianceContent",$microAllianceContent);
		$this->assign("micro_alliance_id",$this->allianceId)->display('save');
	}
}